package com.xishu.entity.plat;

import com.xishu.entity.AbstractEntity;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

@Entity(name = "report_data")
@Table(indexes = {@Index(columnList = "createTime,shopId")})
public class ReportData extends AbstractEntity {
    @ApiModelProperty(value = "分店ID列表")
    @Transient
    private List<Long> shopIdList;

    @ApiModelProperty(value = "分店ID,分店ID如果是0表示是平台的数据，不做另外的索引处理")
    private Long shopId;

    @ApiModelProperty(value = "统计的值")
    private Double value;

    @ApiModelProperty(value = "统计类型，1是C端设备连接数量，2是订单情况，3是实时订单支付数")
    private int type;

    @ApiModelProperty(value = "统计的时间")
    private long reportTime;

    @ApiModelProperty(value = "时间单位,月2592000000，半月1296000000，天86400000，小时3600000")
    @Transient
    private Long timeUnit;

    public List<Long> getShopIdList() {
        return shopIdList;
    }

    public void setShopIdList(List<Long> shopIdList) {
        this.shopIdList = shopIdList;
    }

    public Long getTimeUnit() {
        return timeUnit;
    }

    public void setTimeUnit(Long timeUnit) {
        this.timeUnit = timeUnit;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Double getValue() {
        return value;
    }

    public void setValue(Double value) {
        this.value = value;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public long getReportTime() {
        return reportTime;
    }

    public void setReportTime(long reportTime) {
        this.reportTime = reportTime;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("ReportData{");
        sb.append("shopId=").append(shopId);
        sb.append(", value=").append(value);
        sb.append(", type=").append(type);
        sb.append(", reportTime=").append(reportTime);
        sb.append(", timeUnit=").append(timeUnit);
        sb.append('}');
        return sb.toString();
    }
}
